// 用来解析query数据
// key=value&key=value

const qs = require("querystring");

const queryStr1 = "username=admin&password=123456";
console.log(qs.parse(queryStr1));

const queryObj = {name:"admin",age:18,sex:"男"};
console.log(qs.stringify(queryObj));

const queryStr2 = "username=admin*password=123456";
console.log(qs.parse(queryStr2, "*"));

console.log( qs.escape("上海") );
console.log( qs.unescape("%E4%B8%8A%E6%B5%B7") );

console.log( qs.escape("abc") );
console.log( qs.escape("!") );
console.log( qs.escape("！") );
console.log( qs.escape("*") );
console.log( qs.escape(" ") );